

function httpget(url){
  xmlHttp=GetXmlHttpObject();
  if (xmlHttp==null){
    alert ("Browser does not support HTTP Request");
    return;
  }
  xmlHttp.onreadystatechange=stateChanged;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
}

function httppost(url, content){
  alert(content);
  console.info(content);
  xmlHttp=GetXmlHttpObject();
  if (xmlHttp==null){
    alert ("Browser does not support HTTP Request");
    return;
  }
  xmlHttp.onreadystatechange=stateChanged;
  xmlHttp.open("POST",url,true);
  xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
  xmlHttp.send(content);
}

function GetXmlHttpObject(){
  var xmlHttp=null;
  try{
     // Firefox, Opera 8.0+, Safari
     xmlHttp=new XMLHttpRequest();
   }catch (e){
     // Internet Explorer
     try{
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
     }catch (e){
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
     }
   }
   return xmlHttp;
}
